/**
 * All right reserved@Raygo 2022~2030
 */

package com.raygo.runner.core.data;

import java.util.ArrayList;
import java.util.List;

/**
 * 全流程执行结果
 *
 * @author Raygo
 * @since 2022年5月26日
 */
public class FlowResult {
    /**
     * 唯一ID
     */
    private String uuid;

    /**
     * 序列号
     */
    private String serialNo;

    /**
     * 操作者
     */
    private String operator;

    /**
     * 开始时间
     */
    private String beginTime;

    /**
     * 结束时间
     */
    private String endTime;

    /**
     * 执行结果，0成功，1失败，2停止，3其他
     */
    private int result;

    /**
     * 各组执行结果
     */
    private List<GroupResult> groupResults = new ArrayList<>();

    /**
     * 扩展字段1
     */
    private String extend1;

    /**
     * 扩展字段21
     */
    private String extend2;

    /**
     * 扩展字段3
     */
    private String extend3;

    /**
     * Get extend1 value
     *
     * @return the extend1
     */
    public String getExtend1() {
        return extend1;
    }

    /**
     * Set extend1 to extend1
     *
     * @param extend1 the extend1 to set
     */
    public void setExtend1(String extend1) {
        this.extend1 = extend1;
    }

    /**
     * Get extend2 value
     *
     * @return the extend2
     */
    public String getExtend2() {
        return extend2;
    }

    /**
     * Set extend2 to extend2
     *
     * @param extend2 the extend2 to set
     */
    public void setExtend2(String extend2) {
        this.extend2 = extend2;
    }

    /**
     * Get extend3 value
     *
     * @return the extend3
     */
    public String getExtend3() {
        return extend3;
    }

    /**
     * Set extend3 to extend3
     *
     * @param extend3 the extend3 to set
     */
    public void setExtend3(String extend3) {
        this.extend3 = extend3;
    }

    /**
     * Get result value
     *
     * @return the result
     */
    public int getResult() {
        return result;
    }

    /**
     * Set result to result
     *
     * @param result the result to set
     */
    public void setResult(int result) {
        this.result = result;
    }

    /**
     * Get uuid value
     *
     * @return the uuid
     */
    public String getUuid() {
        return uuid;
    }

    /**
     * Set uuid to uuid
     *
     * @param uuid the uuid to set
     */
    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    /**
     * Get serialNo value
     *
     * @return the serialNo
     */
    public String getSerialNo() {
        return serialNo;
    }

    /**
     * Set serialNo to serialNo
     *
     * @param serialNo the serialNo to set
     */
    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    /**
     * Get operator value
     *
     * @return the operator
     */
    public String getOperator() {
        return operator;
    }

    /**
     * Set operator to operator
     *
     * @param operator the operator to set
     */
    public void setOperator(String operator) {
        this.operator = operator;
    }

    /**
     * Get beginTime value
     *
     * @return the beginTime
     */
    public String getBeginTime() {
        return beginTime;
    }

    /**
     * Set beginTime to beginTime
     *
     * @param beginTime the beginTime to set
     */
    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    /**
     * Get endTime value
     *
     * @return the endTime
     */
    public String getEndTime() {
        return endTime;
    }

    /**
     * Set endTime to endTime
     *
     * @param endTime the endTime to set
     */
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    /**
     * Get groupResults value
     *
     * @return the groupResults
     */
    public List<GroupResult> getGroupResults() {
        return groupResults;
    }

    /**
     * 获取指定名称的组
     *
     * @param groupName 组名称
     * @return 组
     */
    public GroupResult getGroupResult(String groupName) {
        for (GroupResult result : groupResults) {
            if (groupName.equals(result.getName())) {
                return result;
            }
        }
        return null;
    }

    /**
     * Set groupResults to groupResults
     *
     * @param groupResults the groupResults to set
     */
    public void setGroupResults(List<GroupResult> groupResults) {
        this.groupResults = groupResults;
    }
}
